package com.wxzz.elearing.comment.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxzz.elearing.comment.dto.ArticleStatusDto;
import com.wxzz.elearing.comment.dto.CommunityQuestionsAnswersDto;
import com.wxzz.elearing.comment.dto.QuestionsAnswersDto;
import com.wxzz.elearing.comment.entity.CommunityQuestionsAnswersList;
import com.wxzz.elearing.comment.entity.QuestionsAnswersList;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 
 * @since 2021-05-14
 */
public interface CommunityQuestionsAnswersListMapper extends BaseMapper<CommunityQuestionsAnswersList> {

    @Update("UPDATE community_questions_answers_list set is_accept =1 , accept_id =#{model.uid} where id=#{model.id}")
    Integer setAccept(@Param("model") CommunityQuestionsAnswersDto questionsAnswersDto);

    @Update("UPDATE community_questions_answers_list set article_status=#{model.status} , sold_out_cause=#{model.soldOutArticle} wherer id=#{model.articleId}")
    Integer updateStatus(@Param("model") ArticleStatusDto articleStatusDto);
}
